import unittest

from emc.base.models import Item, Book, Computer, Brave, Person

class Test(unittest.TestCase):
    def testName(self):

from base.models import Item, Book, Computer, Brave, Person
item = Item(price=1)
item.put()
book = Book(price=3)
book.put()
computer = Computer(price=100)
computer.put()
brave = Brave(power=95)
brave.put()
person=Person(possessions=[book.key(), computer.key(), brave.key()])
person.put()

sum = 0
for possession in db.get(person.possessions):
    if possession.kind() != 'Brave':
        sum += possession.price
print sum

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()